<template>
	<div class="team-content">
		<div class="team-header">
			<h4>{{ $t('agent.agent_profit_proportion') }}</h4>
			<el-button @click="handleBack">
				返回
			</el-button>
		</div>
		<div class="team-table">
			<Table :data="[Object.assign({}, agentInfo, { isRateTable: true })]" :columns="columns" />
		</div>
	</div>
</template>

<script>
import Table from '@/components/Table'

export default {
	name: 'OwnPointList',
	components: {
		Table
	},
	props: {
		agentInfo: {
			type: Object,
			default: {}
		},
		columns: {
			type: Array,
			default: []
		}
	},
	data() {
		return {
			data: []
		}
	},
	watch: {
		// agentInfo: {
		//     immediate: true,
		// 	deep: true,
		//     handler(val) {
		//         this.loadData()
		// 	}
		// }
	},
	created() {},
	methods: {
		// 处理api
		async loadData() {
			try {
				const ret = await this.$api.rebateRateQuery({
					userName: this.agentInfo.userName,
					userId: this.agentInfo.userId,
					userType: this.agentInfo.userType
				})
				if (ret.code === 200) {
					this.data = ret?.data
				}
			} catch (err) {
				console.log(err)
			}
		},
		handleBack() {
			this.$emit('back')
		}
	}
}
</script>
<style scoped lang="scss">
.team-header {
	display: flex;
	margin-bottom: 10px;
	align-items: flex-end;
	h4 {
		font-weight: 400;
		font-size: 16px;
		margin: 0;
		flex: 1;
	}
}
.team-table {
	margin-bottom: 20px;
	width: 100%;
}
</style>
